import routerList from './router'
import './App.css'
import React, { useContext, useState } from "react"


const Themecontext = React.createContext({} as IThemeContext)
interface IThemeContext {
  theme: string,
  setTheme: (theme: string) => void
}
import { BrowserRouter, Routes, Route, RouterProvider, createBrowserRouter } from 'react-router-dom'
const Parent = () => {
  const theme = useContext(Themecontext)
  return <div>
    <Child1 />
  </div>
}

const Child1 = () => {
  const theme = useContext(Themecontext)
  return <div>
    <div>Child1</div>
  </div>
}
function App() {
  const router = createBrowserRouter(routerList);
  const [theme, setTheme] = useState('dark')


  return (
    <Themecontext.Provider value={{ theme, setTheme }}>
      <RouterProvider router={router} />
      {/* <Parent /> */}
    </Themecontext.Provider>
  )
}

export default App
